export const BOOKS_ISADMIN = 'BOOKS_ISADMIN';
export const BOOKS = 'BOOKS';

// 为saga提供action和actionCreator
export const GET_BOOKS = 'GET_BOOKS';

export const booksIsAdmin = admin => {
	return {
		type: BOOKS_ISADMIN,
		admin
	}
}
export const booksList = books => {
	return {
		type: BOOKS,
		books
	}
}
export const getBooks = data => {
	return {
		type: GET_BOOKS,
		data
	}
}

export const ADD_BOOK = 'ADD_BOOK';
export const SGaddBook = data => {
	return {
		type: ADD_BOOK,
		data
	}
}

export const ADD = 'ADD';
export const addBook = data => {
	return {
		type: ADD,
		data
	}
}

export const REMOVE_BOOK = 'REMOVE_BOOK';
export const SGremoveBook = data => {
	return {
		type: REMOVE_BOOK,
		data
	}
}

export const ISEXISTS_DIRNAME = 'ISEXISTS_DIRNAME';
export const SGisExistsDirname = data => {
	return {
		type: ISEXISTS_DIRNAME,
		data
	}
}

export const REMOVE = 'REMOVE';
export const removeBook = data => {
	return {
		type: REMOVE,
		data
	}
}

export const UPDATE = 'UPDATE';
export const updateBook = data => {
	return {
		type: UPDATE,
		data
	}
}

export const SELECT_VERSION = 'SELECT_VERSION';
export const selectVersion = data => {
	return {
		type: SELECT_VERSION,
		data
	}
}

export const GET_UPLOAD_TOKEN = 'GET_UPLOAD_TOKEN';
export const SGgetUploadToken = data => {
	return {
		type: GET_UPLOAD_TOKEN,
		data
	}
}